{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Lab 9b - 2-fold cross validation\n",
"\n",
"We will finish Lab 9 in this notebook."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"import statsmodels.formula.api as smf\n",
"import seaborn as sns\n",
"import numpy as np\n",
"from sklearn.model_selection import train_test_split\n",
"from sklearn import datasets, linear_model\n",
"from sklearn.model_selection import KFold\n",
"\n",
"\n",
"%matplotlib inline"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" dataset | \n",
" x | \n",
" y | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" I | \n",
" 10.0 | \n",
" 8.04 | \n",
"
\n",
" \n",
" 1 | \n",
" I | \n",
" 8.0 | \n",
" 6.95 | \n",
"
\n",
" \n",
" 2 | \n",
" I | \n",
" 13.0 | \n",
" 7.58 | \n",
"
\n",
" \n",
" 3 | \n",
" I | \n",
" 9.0 | \n",
" 8.81 | \n",
"
\n",
" \n",
" 4 | \n",
" I | \n",
" 11.0 | \n",
" 8.33 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" dataset x y\n",
"0 I 10.0 8.04\n",
"1 I 8.0 6.95\n",
"2 I 13.0 7.58\n",
"3 I 9.0 8.81\n",
"4 I 11.0 8.33"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Load the Anscombe quartet data\n",
"anscombe = sns.load_dataset(\"anscombe\")\n",
"anscombe.head()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" x | \n",
" y | \n",
"
\n",
" \n",
" \n",
" \n",
" 22 | \n",
" 10.0 | \n",
" 7.46 | \n",
"
\n",
" \n",
" 23 | \n",
" 8.0 | \n",
" 6.77 | \n",
"
\n",
" \n",
" 24 | \n",
" 13.0 | \n",
" 12.74 | \n",
"
\n",
" \n",
" 25 | \n",
" 9.0 | \n",
" 7.11 | \n",
"
\n",
" \n",
" 26 | \n",
" 11.0 | \n",
" 7.81 | \n",
"
\n",
" \n",
" 27 | \n",
" 14.0 | \n",
" 8.84 | \n",
"
\n",
" \n",
" 28 | \n",
" 6.0 | \n",
" 6.08 | \n",
"
\n",
" \n",
" 29 | \n",
" 4.0 | \n",
" 5.39 | \n",
"
\n",
" \n",
" 30 | \n",
" 12.0 | \n",
" 8.15 | \n",
"
\n",
" \n",
" 31 | \n",
" 7.0 | \n",
" 6.42 | \n",
"
\n",
" \n",
" 32 | \n",
" 5.0 | \n",
" 5.73 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" x y\n",
"22 10.0 7.46\n",
"23 8.0 6.77\n",
"24 13.0 12.74\n",
"25 9.0 7.11\n",
"26 11.0 7.81\n",
"27 14.0 8.84\n",
"28 6.0 6.08\n",
"29 4.0 5.39\n",
"30 12.0 8.15\n",
"31 7.0 6.42\n",
"32 5.0 5.73"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Separate out the Anscombe 3 data\n",
"anscombe_3 = anscombe[anscombe[\"dataset\"] == \"III\"]\n",
"anscombe_3 = anscombe_3[[\"x\",\"y\"]]\n",
"anscombe_3"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
""
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEKCAYAAAAfGVI8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmc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iPxSRP7a00WW2QrPuTqP3fjvroiIaDV8R0BE5HMMAiIin2MQEBH5HIOAiMjnGARERD7HICAi8jkGARGRzzEIiDZBRO7Nz8WPikhLfk+Eu71eF9Fm8IYyok0Skf8CIAogBnfG03/zeElEm8IgINokEYkAOAUgC+Djqmp7vCSiTeGpIaLN6wHQCnf+TUNukUn+wHcERJskIs/AHXG+D8AOVf13Hi+JaFNCXi+AqB6JyO8CMFX1/4hIEMAvRGRAVYe9XhvRRvEdARGRz/EaARGRzzEIiIh8jkFARORzDAIiIp9jEBAR+RyDgIjI5xgEREQ+xyAgIvK5/w/li5XIRgBZ0AAAAABJRU5ErkJggg==\n",
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Plot Anscombe 3\n",
"sns.regplot(x = \"x\", y = \"y\", data = anscombe_3)"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [],
"source": [
"# Split the data in half into fold 1 and fold 2\n",
"X_fold1, X_fold2, y_fold1, y_fold2 = train_test_split(anscombe_3[[\"x\"]], anscombe_3[\"y\"], test_size=0.5)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" x | \n",
"
\n",
" \n",
" \n",
" \n",
" 30 | \n",
" 12.0 | \n",
"
\n",
" \n",
" 28 | \n",
" 6.0 | \n",
"
\n",
" \n",
" 25 | \n",
" 9.0 | \n",
"
\n",
" \n",
" 22 | \n",
" 10.0 | \n",
"
\n",
" \n",
" 27 | \n",
" 14.0 | \n",
"
\n",
" \n",
" 31 | \n",
" 7.0 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" x\n",
"30 12.0\n",
"28 6.0\n",
"25 9.0\n",
"22 10.0\n",
"27 14.0\n",
"31 7.0"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"X_fold2"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Use the fold 1 data to fit the linear model using the sci-kit learn version:"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"LinearRegression(copy_X=True, fit_intercept=True, n_jobs=None,\n",
" normalize=False)"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"lm_fold1 = linear_model.LinearRegression()\n",
"lm_fold1.fit(X_fold1, y_fold1)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Use this linear model to make predictions for the fold 2 data:"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"fold2_predictions = lm_fold1.predict(X_fold2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Compute the mean squared error for the fold 2 predictions:"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"2.756723420796892"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"((y_fold2 - fold2_predictions)**2).mean()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now let's do the reverse. Use the fold2 data to create the linear model:"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"LinearRegression(copy_X=True, fit_intercept=True, n_jobs=None,\n",
" normalize=False)"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"lm_fold2 = linear_model.LinearRegression()\n",
"lm_fold2.fit(X_fold2, y_fold2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Use this linear model to make predictions for the fold 1 data:"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"fold1_predictions = lm_fold2.predict(X_fold1)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Compute the mean squared error for the fold 1 predictions:"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"3.604766161332178"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"((y_fold1 - fold1_predictions)**2).mean()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"How do the two mean squared errors compare? What might be happening here?\n",
"\n",
"To better understand whaat's happening, let's plot the two training data sets using `regplot()` in Seaborn. \n",
"\n",
"First plot the fold 1 data, where x is `X_fold1[\"x\"]` and y is `y_fold1`."
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
""
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAEKCAYAAAAFJbKyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAIABJREFUeJzt3XuU3Hd53/H3M9edmdVqd1aWZGlXMjYuNHHAgbVCEkINJo7RcXFLCTEnCRiSyuaElvRGoc4x1ElTCKSpW+dgXNs1ycE2lOKgwzHGAkpN25hYIg5Y2GBjrJsly9bqvre5PP1jfrOanZ2Z3VntzG8un9c5OnP77exjeTXPfr/P9/t8zd0RERFZrkjYAYiISHdR4hARkaYocYiISFOUOEREpClKHCIi0hQlDhERaYoSh4iINEWJQ0REmqLEISIiTYmFHUArrFu3zi+66KKwwxAR6Rp79ux52d0vWM61PZk4LrroInbv3h12GCIiXcPM9i33Wk1ViYhIU5Q4RESkKUocIiLSFCUOERFpihKHiIg0RYlDRESaosQhIiJNUeIQEZGmKHGIiPS5M7P5pq7vyZ3jIiLSmLtzZjbPiakcuUKxqa9V4hAR6XLffvoon330OQ4cn2J8JM2Nb7qYK1+9fsE17s5MrshMrsBMvsBMroi7r+j7KXGIiHSxbz99lFt27iUeNYZTc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